
#认识while
'''
num = 1
while num <= 100:
    print("%d"%num)#print(i)
    num = num+1
'''
#while嵌套
'''
i = 1
j = 1
while i <= 5:
    while j <= i:
        print("*",end="")
        j++
    print("")
    j = 1
    i++
'''
#九九乘法表
'''
i = 1
while i<=9:
    j = 1
    while j<=i:
        mul = i*j
        print("%d*%d=%d\t"%(j,i,mul),end="")
        j+=1
    print("")
    i+=1
'''
#石头剪刀布
'''
import random
player = int(input("请输入 0剪刀 1石头 2布:"))
computer = random.randint(0,2)
print(computer)
if (player==0 and computer==2) or (player==1 and computer==0) or (player==2 and computer==1):
    print("win")
elif player==computer:
    print("draw")
else:
    print("lost")
'''
#打印1-100的偶数,break
'''
i = 1
j = 0
while i <= 100:
    if i%2==0:
        j+=1
        print(i)
    if j==20:
        break
    i+=1

#break and continue
i = 1
while i <= 10:
    print("------")
    i=i+1
    if i==3:
        continue
    print(i)
print("++++++")

'''
sum = 0
n = 99
while n > 0:
    sum = sum + n
    n = n - 2
print(sum)

L = ['Bart', 'Lisa', 'Adam']
for name in L:
    print('Hello, ',name)

n = 0
while n < 10:
    n = n + 1
    if n % 2 == 0:
        continue
    print(n)


